package com.justnow.offer;

import java.util.HashSet;
import java.util.Set;

public class Solution01 {
    public int findRepeatNumber(int[] nums) {
        Set<Integer> set = new HashSet<>();
        int result = 0;
        for(Integer n : nums) {
            if (set.contains(n)) {
                result =  n;
                break;
            }
            set.add(n);
        }
        return result;
    }
}
